package com.wavehi.data_access_mybatis.mapper;

import com.wavehi.data_access_mybatis.domain.Staff;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.yaml.snakeyaml.events.Event;

import java.util.List;

/**
 * @Author WaveHi
 * @Date 19/11/2021 下午 10:08
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
@Mapper
public interface StaffMapper {

    @Select("select s_id id, s_name name, s_wage wage from t_staff_01")
    List<Staff> selectAll();

    @Insert("insert into t_staff_01(s_name, s_wage) values(#{name}, #{wage})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int insert(Staff staff);

}
